/*
 * Copyright 2017 Baiyyy
 * @(#)Global.java
 */

package com.byyy.ccts.modules.cc;

import com.byyy.ccts.core.utils.JeewebPropertiesUtil;

/**
 * 通用设置常数化保存
 * Created by DELL on 2018-4-26.
 */
public class Global {

    /**
     * 报文通用设置
     */
    /** 包头 */
    public static final byte PACK_START = 0x7E;
    /** 包尾 */
    public static final byte PACK_END = 0x7E;

    /**
     * 常用设备指令设置
     */
    /** 设备指令-登录 */
    public static final byte ISTR_LOGIN = 0x31;
    /** 设备指令-通用应答 */
    public static final byte ISTR_DEVICE_RESPONSE = 0x30;
    /** 设备指令-服务器应答 */
    public static final byte ISTR_SERVER_RESPONSE = 0x60;
    /** 设备指令-178A实时消息上报 */
    public static final byte ISTR_REALTIME_REPORT = 0x35;
    /** 设备指令-178D实时消息上报 */
    public static final byte ISTR_D_REALTIME_REPORT = 0x3A;
    /** 设备指令-178A补传数据上报 */
    public static final byte ISTR_SUPPLEMENT_REPORT = 0x39;
    /** 设备指令-178D补传数据上报 */
    public static final byte ISTR_D_SUPPLEMENT_REPORT = 0x3B;

    /**
     * 常用设备操作指令
     */
    /** 设备操作指令-设置报位间隔 */
    public static final byte DEVICE_OTP_0X62 = 0x62;
    /** 设备操作指令-设定温度报警 */
    public static final byte DEVICE_OTP_0X64 = 0x64;
    /** 设备操作指令-温度湿度光感预警报警总开关 */
    public static final byte DEVICE_OTP_0X73 = 0x73;
    /** 设备操作指令-设置报位间隔 */
    public static final byte DEVICE_OTP_0X78 = 0x78;
    /** 设备操作指令-设定温度报警-开始时间10-01-01 00:00:00 */
    public static final byte[] DEVICE_OTP_64_STARTTIME = new byte[] {
        0x0A, 0x01, 0x01, 0x00, 0x00, 0x00
    };
    /** 设备操作指令-设定温度报警-结束时间99-12-31 23:59:59 */
    public static final byte[] DEVICE_OTP_64_ENDTIME = new byte[] {
            0x63, 0x0C, 0x01, 0x1F, 0x3B, 0x3B
    };

    /**
     * 其他设置
     */
    /** 补传数据每条结束标志 */
    public static final byte OTH_SUPPLEMENT_END = (byte) 0xAF;
    /** 符号-正 */
    public static final byte OTH_TEMP_SYMBOL_PLUS = 0x01;
    /** 符号-负 */
    public static final byte OTH_TEMP_SYMBOL_MINUS = 0x00;

    /**
     * 178D中的扩展信息ID
     */
    /** 扩展信息ID-0x01 */
    public static final byte EXT_0X01= 0x01;
    /** 扩展信息ID-0x02 */
    public static final byte EXT_0X02= 0x02;
    /** 扩展信息ID-0x03 */
    public static final byte EXT_0X03= 0x03;

    /** 拆包时最小长度 */
    public static final int MIN_LEN = 2;

    /** V1.2版本 */
    public static final String VER_1_2 = "V1.2";

    /**
     * 缓存KEY
     */
    /** 设备列表缓存KEY */
    public static final String KEY_DEVICE_LIST = "KEY_DEVICE_LIST";
    public static final String KEY_BOXATTR_LIST = "KEY_BOXATTR_LIST";
    public static final String KEY_COUVENSE_LIST = "KEY_COUVENSE_LIST";
    public static final String KEY_CHILLCAR_LIST = "KEY_CHILLCAR_LIST";
    public static final String KEY_MINUTE_LIST = "KEY_MINUTE_LIST";

    /**
     * Access操作SQL
     */
    /** 插入Record表SQL */
    public static final String SQL_INSERT_RECORD = "INSERT INTO RECORD(WZNAME, IPADDR, WDZ, SDZ, DT, KFSX, GPSJD, GPSWD, SJWDZ, SJSDZ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";

    /**
     * OA
     */
    public static String OA_TOKEN_URL = "http://soa.baiyyy.com:8011/DFStageSystem/dfStageGetTokenRest";
    public static String OA_TOKEN_AUTH = "V2VDaGF0OndlbGNvbWUx";
    public static String OA_TOKEN_USER = "{\"username\":\"wms\"}";
    public static String OA_MAIL_WX_URL = "http://soa.baiyyy.com:8011/OA/InsertBahealMailCommon/InsertBahealMailService";

    /**
     * RMI远程服务地址_青岛仓
     */
    public static String RMI_UPLOAD_SERVICE_QD = JeewebPropertiesUtil.getConfig("rmi.qingdao");

    /**
     * RMI远程服务地址_济南仓
     */
    public static String RMI_UPLOAD_SERVICE_JN = JeewebPropertiesUtil.getConfig("rmi.jinan");

    /**
     * RMI远程服务地址_黄岛仓
     */
    public static String RMI_UPLOAD_SERVICE_CK099002 = JeewebPropertiesUtil.getConfig("rmi.CK099002");

    /**
     * RMI远程服务地址_西岸仓
     */
    public static String RMI_UPLOAD_SERVICE_CK099009 = JeewebPropertiesUtil.getConfig("rmi.CK099009");

    /**
     * 日期格式化PATTERN
     */
    public static String PATTERN_YYYYMMMDD_HHMMSS = "yyyy-MM-dd HH:mm:ss";

    public static String PATTERN_YYYYMMMDD = "yyyy-MM-dd";

    /** 最小预警范围 */
    public static float FIXED_VALUE = 0.5f;

    public static String SPLIT_COMMA = ",";
}
